package com.dq.controller.op.opboss.set;

import com.dq.exception.customException.AdminException;
import com.dq.vo.Vo;
import com.dq.domain.setup.TrackGenerateRateSet;
import com.dq.service.AllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author luchangtong
 * @Date 2019/12/9 11:20
 */
@Api(description = "后台跟踪记录生成管理")
@RestController
@RequestMapping("/op/boss/trackGenerateRateSet")
public class TrackGenerateRateSetController extends AllService {

    @ApiOperation("查看生成设置")
    @RequestMapping("get/{status}")
    public Vo get(TrackGenerateRateSet.SetStatus status)throws AdminException{
        return new Vo(trackGenerateRateSetService.get(status));
    }

    @ApiOperation("修改生成设置")
    @PostMapping("update")
    public Vo update(@RequestBody TrackGenerateRateSet trackGenerateRateSet)throws AdminException{
        trackGenerateRateSetService.update(trackGenerateRateSet);
        return new Vo(HttpStatus.OK);
    }
}
